package cn.livingCloud.dto;

import cn.livingCloud.entity.core.Employee;
import cn.livingCloud.utils.DateUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by DingJie on 2016/5/30.
 */
public class EmployeeDto {
    protected String createDateTime;
    protected Boolean archive;
    private String uuid;
    private String name;
    private String gender;
    private String age;
    private String phone;
    private String deptUuid;
    private boolean isLeader;
    private boolean inspector;
    private DeptDto deptDto;
    private List<String> nickNameList = new ArrayList<>();

    public EmployeeDto(Employee item) {
        this.uuid = item.getUuid();
        this.name = item.getName();
        this.archive = item.getArchive();
        this.createDateTime = DateUtils.toDateText(item.getCreateDateTime()
                , DateUtils.DEFAULT_DATE_TIME_FORMAT);
        this.gender = item.getGender();
        this.age = item.getAge().toString();
        this.phone = item.getPhone();
        this.deptUuid = item.getDeptUuid();
        this.isLeader = item.getIsLeader();
        this.deptDto = new DeptDto(item.getDept());
        this.nickNameList = item.getNickName();
        this.inspector = item.isInspector();
    }

    public EmployeeDto() {
    }

    public boolean isInspector() {
        return inspector;
    }

    public EmployeeDto setInspector(boolean inspector) {
        this.inspector = inspector;
        return this;
    }

    public List<String> getNickNameList() {
        return nickNameList;
    }

    public EmployeeDto setNickNameList(List<String> nickNameList) {
        this.nickNameList = nickNameList;
        return this;
    }

    public String getCreateDateTime() {
        return createDateTime;
    }

    public void setCreateDateTime(String createDateTime) {
        this.createDateTime = createDateTime;
    }

    public Boolean getArchive() {
        return archive;
    }

    public void setArchive(Boolean archive) {
        this.archive = archive;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getDeptUuid() {
        return deptUuid;
    }

    public void setDeptUuid(String deptUuid) {
        this.deptUuid = deptUuid;
    }

    public boolean isLeader() {
        return isLeader;
    }

    public void setIsLeader(boolean isLeader) {
        this.isLeader = isLeader;
    }

    public DeptDto getDeptDto() {
        return deptDto;
    }

    public void setDeptDto(DeptDto deptDto) {
        this.deptDto = deptDto;
    }
}
